package com.inspur.myapplication.view;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;

import com.inspur.myapplication.R;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;

public class ImageLoaderActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_image_loader);

        //实例化ImageLoader
        ImageLoader imageLoader=ImageLoader.getInstance();

        //进行初始化
        ImageLoaderConfiguration imageLoaderConfiguration=new  ImageLoaderConfiguration.Builder(this).build();
        imageLoader.init(imageLoaderConfiguration);

        //显示图片
        ImageView imageView=(ImageView) findViewById(R.id.imageloader_iv);
        imageLoader.displayImage("https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1541231763,2897362241&fm=26&gp=0.jpg",imageView);
    }


}
